package ui.scene {
	import flash.display.Scene;
	import flash.utils.Dictionary;
	
	import util.Logger;

	public class SceneManager {
		
		public var currentScene:IScene;
		
		public static const SCENES:Dictionary = new Dictionary();

		public function init():void {
			SCENES[BaseScene.GAME_SCENE] = new GameScene();
			SCENES[BaseScene.STAGE_SCENE] = new StageScene();
		}
		
		public function SceneManager() {
		}
		
		public function enter(type:uint):void {
			var scene:BaseScene = SCENES[type];
			if (scene == null) {
				Logger.error("scene not register");
				return;
			}
			if (currentScene != null) {
				currentScene.exit();
			}
			currentScene = scene;
			scene.enter();
		}
		
		public function getCurrentScene():IScene {
			return currentScene;
		}
	}
}